<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="renderer" content="webkit">
    <meta name="force-rendering" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta name="format-detection" content="telephone=no,email=no,adress=no">
    <meta name="author" content="leslie">
    <meta name="keywords" content="">
    <meta name="robots" content="index">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="./css/reset.css" />
    <link rel="stylesheet" href="./css/main.css" />
    <script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>
    <script src="./js/jquery.min.js"></script>
    <title>产品列表</title>
    <script>
    (function(doc, win) {
        var docEl = doc.documentElement,
            resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
            recalc = function() {
                var clientWidth = docEl.clientWidth;
                if (!clientWidth) return;
                if (clientWidth > 1080) {
                    docEl.style.fontSize = '80px';
                } else {
                    docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
                }
            };
        if (!doc.addEventListener) return;
        win.addEventListener(resizeEvt, recalc, false);
        doc.addEventListener('DOMContentLoaded', recalc, false);
    })(document, window);
    </script>
</head>

<body>
    <div class="main-box" id="app" v-clock>
        <div class="head-box">
            <p class="head-top">
                <img :src="headData.logo">
                <span v-text="headData.name"></span>
            </p>
            <img class="head-middle" src="./img/percent.png">
            <p class="head-bottom">
                <span>申请资格</span>
                <span>最高额度</span>
                <span>最快放款</span>
            </p>
            <a class="head-btn" :href="headData.link">立即申请</a>
        </div>
        <ul class="list-box">
            <p class="list-title">
                <span></span>
                高额推荐
            </p>
            <li class="list-li" v-for="(item, index) in dataList" v-if="index>0 && index<3" @click="goHref(item.link)">
                <p class="list-name">
                    <img :src="item.logo">
                    <span v-text="item.name"></span>
                </p>
                <p class="list-pub-one">
                    <span class="list-text-one">最高额度</span>
                    <span class="list-text-two">{{item.detail.limit.split('-')[1]}}</span>
                </p>
                <p class="list-pub-two">
                    <span class="list-text-one">通过率</span>
                    <span class="list-text-two">{{item.detail.successRate}}%</span>
                </p>
            </li>
        </ul>
        <ul class="list-box">
            <p class="list-title">
                <span></span>
                大数据精准推荐
            </p>
            <li class="list-li" v-for="(item, index) in dataList" v-if="index>2" @click="goHref(item.link)">
                <p class="list-name">
                    <img :src="item.logo">
                    <span v-text="item.name"></span>
                </p>
                <p class="list-pub-one">
                    <span class="list-text-one">最高额度</span>
                    <span class="list-text-two">{{item.detail.limit.split('-')[1]}}</span>
                </p>
                <p class="list-pub-two">
                    <span class="list-text-one">通过率</span>
                    <span class="list-text-two">{{item.detail.successRate}}%</span>
                </p>
            </li>
        </ul>
    </div>
</body>
<script>
var vm = new Vue({
    el: '#app',
    data: {
        headData: '',
        dataList: [],
    },
    methods: {
        goHref: function(link) {
           window.location.href = link
        }
    },
    mounted: function() {
        var that = this
        $.ajax({
            url: 'http://res.txingdai.com/site/45422b152c2335bed61e4b8dfbec3273',
            type: 'get',
            dataType: 'jsonp',
            success: function(data) {
                that.dataList = data.data.list
                that.headData = data.data.list[0]
            }
        })
    }
})
</script>

</html>